﻿@{
    ViewBag.Title = "润滑记录";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section scripts{
        <script src="~/Areas/Dev/ViewModels/Dev.viewModel.search.js"></script>
        <script type="text/javascript">
//            using(['datagrid','messager']);
            using(['numberbox','lookup','combobox']);
            var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
            var viewModel = function(data){ 
                var self = this;
                Dev.viewModel.search.apply(self,arguments);
            } 
            
            ko.bindingViewModel(new viewModel(data));
           
        </script>
}
<div class="z-toolbar">
    <a id="a_refresh" href="#" plain="true" class="easyui-linkbutton" icon="icon-arrow_refresh" title="刷新" data-bind="click:refreshClick">刷新</a>
    <a id="a_add"    href="#" plain="true" class="easyui-linkbutton" icon="icon-add" title="新增" data-bind="click:addClick">新增</a>
    <a id="a_edit"   href="#" plain="true" class="easyui-linkbutton" icon="icon-edit" data-bind="click:editClick" title="编辑">编辑</a>
    <a id="a_del"    href="#" plain="true" class="easyui-linkbutton" icon="icon-cross" title="删除" data-bind="click:deleteClick">删除</a>
    <a id="a_audit"  href="#" plain="true" class="easyui-linkbutton" icon="icon-user-accept" data-bind="click:auditClick" title="审核">审核</a>
    <a id="a_export" href="#" class="easyui-splitbutton" data-options="menu:'#dropdown',iconCls:'icon-download'">导出</a>
</div>

<div id="dropdown" style="width:100px; display:none;">  
    <div data-options="iconCls:'icon-ext-xls'"      suffix="xls"    data-bind="click:downloadClick">Excel2003   </div>  
    <div data-options="iconCls:'icon-page_excel'"   suffix="xlsx"   data-bind="click:downloadClick">Excel2007   </div>  
    <div data-options="iconCls:'icon-ext-doc'"      suffix="doc"    data-bind="click:downloadClick">Word2003    </div>  
</div> 
<div id="condition" class="container_12" style="position:relative;">
    <div class="grid_1 lbl">单据编号</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.Rhjl_BillNo" class="z-txt"/></div>
    <div class="grid_1 lbl">设备名称</div>
    <div class="grid_2 val"><input type="text" data-bind="lookupValue:form.Rhjl_Sbbh" class="z-txt easyui-lookup" data-options="lookupType:'sbda',multiple:false"/></div>
    <div class="grid_1 lbl">起始日期</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.Rhjl_Kssj" class="z-txt easyui-daterange"/></div>
    <div class="clear"></div>
       
    <div class="grid_1 lbl">结束日期</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.Rhjl_Jssj" class="z-txt easyui-daterange"/></div>       
    <div class="grid_1 lbl">备注说明</div>
    <div class="grid_2 val"><input type="text" data-bind="value:form.Rhjl_Remark" class="z-txt"/></div>
    <div class="clear"></div>

    <div class="prefix_9" style="position:absolute;top:5px;height:0;">  
        <a id="a_search" href="#" class="button button-blue" style="margin:0 15px;" data-bind="click:searchClick">查询</a> 
        <a id="a_reset" href="#" class="button button-blue" data-bind="click:clearClick">清空</a>
    </div>
</div>

<table id="gridlist" data-bind="datagrid:grid">
        <thead>  
        <tr>  
            <th field="Rhjl_BillNo"  sortable="true" align="left"    width="110"  >单据编号</th>  
            <th field="Rhjl_Sbbh"    sortable="true" align="left"    width="100"  >设备编号</th> 
            <th field="Sbda_Sbmc"    sortable="true" align="left" width="150">设备名称</th>
            @*<th field="Rhjl_Bmbh"    sortable="true" align="left"    width="70"  >润滑部门编号</th> *@
            <th field="Rhjl_Bmmc"    sortable="true" align="left"    width="100"  >润滑部门</th> 

            <th field="Rhjl_Rhr"     sortable="true" align="left"    width="80"  >润滑人</th>  
            <th field="Rhjl_Kssj"    sortable="true" align="center""    width="70" formatter="com.formatDate" >开始时间</th> 
            <th field="Rhjl_Jssj"    sortable="true" align="center"  width="70" formatter="com.formatDate">结束时间</th> 
            <th field="Rhjl_Rhgs"    sortable="true" align="right"    width="60" editor="{type:'numberbox',options:{precision:2}}" >润滑工时</th> 
             
            <th field="Rhjl_Tjgs"    sortable="true" align="right"    width="60" editor="{type:'numberbox',options:{precision:2}}" >停机工时</th> 
            <th field="Rhjl_Rhnr"    sortable="true" align="left"  width="120" >润滑内容</th> 
            <th field="Rhjl_Rhyq"    sortable="true" align="left"  width="120" >具体要求</th> 
            <th field="Rhjl_Remark"  sortable="true" align="left"  width="120" >备注说明</th>
  
            <th field="CreatePerson" sortable="true" align="left"  width="70"   >创建人</th>  
            <th field="CreateDate"   sortable="true" align="center"  formatter="com.formatDate"  width="70" >创建日期</th>   
                    
        </tr>                            
    </thead>      
</table> 
